package org.lonetree.tc.core.exception;


/**
 * Exception to throw when an attribute of an item cannot be null.
 *
 */
public class AttributeCannotBeNullException extends RuntimeException{

	private static final long serialVersionUID = 1L;
	
	private String attributeName;
	
	public AttributeCannotBeNullException(String attributeName){
		super("Attribute cannot be null: " + attributeName);
		this.attributeName = attributeName;
	}
	
	public AttributeCannotBeNullException(String attributeName, NullPointerException e){
		this(attributeName);
		initCause(e);
	}
	
	public String getAttributeName(){
		return attributeName;
	}

}
